//
//  TheStoreTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/17.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "TheStoreTableViewCell.h"

@implementation TheStoreTableViewCell{
    GLGWLabel * storeLabel;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        storeLabel = [[GLGWLabel alloc] initWithFrame:CGRectMake(0, kHeightProportion_In_iPhoneTriploid(15), KScreenWidth, kHeightProportion_In_iPhoneTriploid(22)) theFont:SYSTEMFONT(16) theColor:kColor_Rule_Black inSuperView:self];
        
        storeLabel.textAlignment = NSTextAlignmentCenter;
        //
        CGFloat butWidth = (KScreenWidth - kWidthProportion_In_iPhoneTriploid(50))/2;
        NSArray * butTitArr = @[@"联系卖家",@"进入店铺"];
        NSArray * imageArr = @[@"icon_dianhua",@"icon_dianpu_jinru"];
        for (int i=0; i<2; i++) {
            GLGWButton * butLianx = [[GLGWButton alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(15)+ butWidth*i +kWidthProportion_In_iPhoneTriploid(20)*i, kY_With_View(storeLabel, 16), butWidth, kHeightProportion_In_iPhoneTriploid(40)) hTitle:butTitArr[i] titleLableFont:SYSTEMFONT(16) titleLableColor:[UIColor colorWithHexString:@"#999999"] theCornerRadius:3.0 theBorderWidth:1.0 theBorderColor:[UIColor colorWithHexString:@"#EAEAEA"] backgroundColr:[UIColor whiteColor] inSuperView:self];
            butLianx.tag = 310+i;
            butLianx.image_Name = imageArr[i];
            [butLianx setImagePositionWithType:SSImagePositionTypeLeft spacing:kWidthProportion_In_iPhoneTriploid(10)];
            [butLianx addTarget:self action:@selector(storeButAction:) forControlEvents:UIControlEventTouchUpInside];
        }
        
    }
    return self;
}

-(void)setStoreNameStr:(NSString *)storeNameStr{
    _storeNameStr = storeNameStr;
    storeLabel.attributedText = [GLGWLabel addImageName:@"icon_dianpu" theImageFram:CGRectMake(0, -2, 17, 15) theTextString:[NSString stringWithFormat:@"  %@",koString(_storeNameStr)] atImageIndex:0];
}

-(void)storeButAction:(GLGWButton *)sender{
    if (self.Block_ConverStore) {
        self.Block_ConverStore(sender);
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
